//
//  StatusDetailView.m
//  CC
//
//  Created by Calvin on 5/19/15.
//  Copyright (c) 2015 Calvin. All rights reserved.
//

#import "StatusDetailView.h"
#import "StatusOriginalView.h"
#import "StatusRetweetedView.h"
#import "StatusDetailFrame.h"
#import "UIImage+Extension.h"

@interface StatusDetailView ()
@property (nonatomic,weak) StatusOriginalView *originalView;
@property (nonatomic,weak) StatusRetweetedView *retweetedView;
@end

@implementation StatusDetailView
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.image = [UIImage resizedImage:@"timeline_card_top_background"];
        [self setupOriginalView];
        [self setupRetweetedView];
    }
    return self;
}

-(void)setupOriginalView
{
    StatusOriginalView *originalView = [[StatusOriginalView alloc] init];
    [self addSubview:originalView];
    self.originalView=originalView;
}

-(void)setupRetweetedView
{
    StatusRetweetedView *retweetedView = [[StatusRetweetedView alloc] init];
    [self addSubview:retweetedView];
    self.retweetedView =retweetedView;
}

-(void)setDetailFrame:(StatusDetailFrame *)detailFrame
{
    _detailFrame = detailFrame;
    self.frame = detailFrame.frame;
    self.originalView.originalFrame = detailFrame.originalFrame;
    self.retweetedView.retweetedFrame = detailFrame.retweetedFrame;
}
@end
